<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="html" />

	<xsl:template match="experiment">
		<h1>Experiment Description</h1>
		<table>
			<tr><td><b>Name: </b></td><td><xsl:value-of select="./@label"/></td></tr>
			<xsl:apply-templates />
		</table>
		<hr width="100%" />
	</xsl:template>

	<xsl:template match="data_loaders">
			<tr><td colspan="2"><b>Data Loaders</b></td></tr>
			<xsl:apply-templates />
	</xsl:template>

	<xsl:template match="level_2_data_loader">
		<tr><td>&#160;</td><td>
				Level II Data Loader [Depth = <xsl:value-of select="./@depth" /> meters]
				<xsl:apply-templates />
		</td></tr>
	</xsl:template>

	<xsl:template match="extended_pulse_volume_factory">
		<tr><td>&#160;</td><td>
				&#160; &#160; &#160; Extended Pulse Volume Factory [Depth = <xsl:value-of select="./@depth" />
				meters, Kernel Size = <xsl:value-of select="./@kernel_size" /> 
				pulse volumes]
		</td></tr>
	</xsl:template>

	<xsl:template match="pre_processors">
			<tr><td colspan="2"><b>Pre-Processors</b></td></tr>
			<xsl:apply-templates />
	</xsl:template>

	<xsl:template match="attribute_removal_pre_processor">
		<tr><td>&#160;</td><td>
				Attribute Removal Pre-Processor 
				[Indices = <xsl:value-of select="./@indices" />,
				Invert = <xsl:value-of select="./@invert" />]
		</td></tr>
	</xsl:template>

	<xsl:template match="subsample_pre_processor">
		<tr><td>&#160;</td><td>
				Subsample Pre-Processor 
				[Sample Size = <xsl:value-of select="./@sample_size" />%]
		</td></tr>
	</xsl:template>

	<xsl:template match="cross_validation_data_provider">
		<tr><td colspan="2"> <b>Cross Validation Data Provider</b>
				[Number of Folds = <xsl:value-of select="./@folds" />,
				Files Per Fold = <xsl:value-of select="./@files_per_fold" />,
				Directory = <xsl:value-of select="./@directory" />]
		</td></tr>
	</xsl:template>

	<xsl:template match="naive_bayes">
		<tr><td colspan="2"> <b>Naive Bayes Classifier</b>
		</td></tr>
	</xsl:template>

	<xsl:template match="support_vector_machine">
		<tr><td colspan="2"> <b>Support Vector Machine Classifier</b>
		</td></tr>
	</xsl:template>

	<xsl:template match="k_nearest_neighbor">
		<tr><td colspan="2"> <b>K Nearest Neighbor Classifier</b>
            [K = <xsl:value-of select="./@k" />]
		</td></tr>
	</xsl:template>

	<xsl:template match="multilayer_perceptron">
		<tr><td colspan="2"> <b>Multilayer Perceptron Classifier</b><br />
            [Auto Build = <xsl:value-of select="./@auto_build" />, <br />
            Learning Rate = <xsl:value-of select="./@learning_rate" />,<br />
            Decay = <xsl:value-of select="./@decay" />,<br />
            Hidden Layers = <xsl:value-of select="./@decay" />,<br />
            Training Time = <xsl:value-of select="./@training_time" />,<br />
            Normalize Attributes = <xsl:value-of select="./@normalize_attributes" />,<br />
            Validation Set Size = <xsl:value-of select="./@validation_set_size" />]
		</td></tr>
	</xsl:template>

	<xsl:template match="post_processors">
			<tr><td colspan="2"><b>Post-Processors</b></td></tr>
			<xsl:apply-templates />
	</xsl:template>

	<xsl:template match="validation_post_processor">
		<tr><td>&#160;</td><td>
				Validation Post Processor
				[Output = <xsl:value-of select="./@output" />]
		</td></tr>
		<tr><td>&#160;</td><td>
				&#160; &#160; &#160; Sweep Rule : 
				<xsl:apply-templates select="./sweep_rule" />
		</td></tr>
		<tr><td>&#160;</td><td>
				&#160; &#160; &#160;	Pulse Rule : 
				<xsl:apply-templates select="./pulse_rule" />
		</td></tr>
	</xsl:template>

	<xsl:template match="threshold_rule">
		Threshold Rule [Threshold = <xsl:value-of select="./@threshold" />,
							 Target Class = <xsl:value-of select="./@target" />]
	</xsl:template>

	<xsl:template match="majority_rule">
		Majority Rule 
	</xsl:template>

	<xsl:template match="training_files">
		<xsl:param name="index" select="0" />

		<xsl:if test="$index &gt; 0">
			<table border="1">
				<tr><th><a href="javascript:showhide(document.getElementById('trainingfiles{$index}'))">Training Files</a></th></tr>
			</table>
			<table border="1" style="display: none" id="trainingfiles{$index}">
				<xsl:apply-templates select="./training_file"/>
			</table>
		</xsl:if>

		<xsl:if test="$index = 0">
			<table border="1">
				<tr><th>Training Files</th></tr>
				<xsl:apply-templates select="./training_file"/>
			</table>
		</xsl:if>
				
	</xsl:template>

	<xsl:template match="training_file">
		<tr><td><xsl:value-of select="."/></td></tr>
	</xsl:template>

	<xsl:template match="target_files">
		<table border="1">
			<tr><th colspan="5">Target Files</th></tr>
			<tr>
				<th>File Name</th>
				<th>Class 0</th>
				<th>Class 1</th>
				<th>True Class</th>
				<th>Predicted Class</th>
			</tr>
			<xsl:apply-templates select="./target_file" />
		</table>
	</xsl:template>

	<xsl:template match="target_file">
		<tr>
			<td><xsl:value-of select="./@name" /></td>
			<td><xsl:value-of select="./distribution/class[@index = 0]" /></td>
			<td><xsl:value-of select="./distribution/class[@index = 1]" /></td>
			<xsl:choose>
				<xsl:when test="@predicted_class != @true_class">
					<td class="error"><xsl:value-of select="./@true_class" /></td>
					<td class="error"><xsl:value-of select="./@predicted_class" /></td>
				</xsl:when>
				<xsl:otherwise>
					<td><xsl:value-of select="./@true_class" /></td>
					<td><xsl:value-of select="./@predicted_class" /></td>
				</xsl:otherwise>
			</xsl:choose>
		</tr>
	</xsl:template>

</xsl:stylesheet>
